Fix: spec validation in right place#4116
Open
nu1lspaxe wants to merge 2 commits intoray-project:masterfrom
Open
Fix: spec validation in right place#4116nu1lspaxe wants to merge 2 commits intoray-project:masterfrom
nu1lspaxe wants to merge 2 commits intoray-project:masterfrom
Conversation
kevin85421
reviewed
Oct 7, 2025
d05d922 to
717af47
Compare
win5923
reviewed
Oct 8, 2025
Member
win5923
left a comment
There was a problem hiding this comment.
Let’s keep this PR focused on replicas validation and handle the CI migration in another one.
that would make it easier to review.
3f37ada to
40b97cf
Compare
Member
|
Hi @nu1lspaxe, Sorry we merged a Volcano PR which introduced some conflicts. |
1. Remove validation logic in GetWorkerGroupDesiredReplicas (utils.go), and append to ValidateRayClusterSpec. 2. Add other validation logic for worker group specs. 3. Remove unnecessary test cases in GetWorkerGroupDesiredReplicas. Fix: MinReplicas / MaxReplicas should verify if autoscaling is not enabled 1. fix golangci-lint test (unused ctx)
6452117 to
98ef48b
Compare
Signed-off-by: Erica Lin <nu1lspaxe.anonym0ux@gmail.com>
Member
Future-Outlier
left a comment
There was a problem hiding this comment.
cc @JiangJiaWei1103 @machichima @CheyuWu help review this PR.
Contributor
|
Hi @nu1lspaxe, would you mind rebasing with the master branch? Thanks. |
Comment on lines
+42
to
+44
| // Check if autoscaling is enabled once to avoid repeated calls | ||
| isAutoscalingEnabled := IsAutoscalingEnabled(spec) | ||
|
|
Contributor
There was a problem hiding this comment.
Since we move the replica validation logic here and below, could we add unit tests for them? Thanks.
| } | ||
| // When autoscaling is enabled, the Ray Autoscaler will manage replicas and | ||
| // eventually adjust them to fall within minReplicas/maxReplicas bounds. | ||
| if workerGroup.Replicas != nil && !isAutoscalingEnabled && workerGroup.MinReplicas != nil && workerGroup.MaxReplicas != nil { |
Contributor
There was a problem hiding this comment.
Suggested change
| if workerGroup.Replicas != nil && !isAutoscalingEnabled && workerGroup.MinReplicas != nil && workerGroup.MaxReplicas != nil { | |
| if !isAutoscalingEnabled && workerGroup.Replicas != nil { |
- Put
isAutoscalingEnabledfirst to short-circuit the check if autoscaling is enabled - Remove redundant checks which are already done at line 51
- If we reach this line with autoscaling disabled, it means
MinReplicas != nil && MaxReplicas != nil.
- If we reach this line with autoscaling disabled, it means
4 tasks
Member
|
Hi, @nu1lspaxe sorry for the late reply, do you still have bandwidth to work on this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why are these changes needed?
Move worker group replica validation from GetWorkerGroupDesiredReplicas to ValidateRayClusterSpec to centralize and improve spec validation, and remove redundant tests.
Related issue number
#4101 (Move Replica validation to
validation.go)Checks